home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / swtools / libdwarf / libdwarf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  39.7 KB  |  1,454 lines

  1. #ifndef _LIBDWARF_H
  2. #define _LIBDWARF_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /*
  7.     libdwarf.h  
  8.     $Revision: 1.56 $ $Date: 1994/06/20 18:40:33 $
  9.  
  10.     For libdwarf producers and consumers
  11.  
  12.     The interface is defined as having 8-byte signed and unsigned
  13.     values so it can handle 64-or-32bit target on 64-or-32bit host.
  14.     Addr is the native size: it represents pointers on
  15.     the host machine (not the target!).
  16.  
  17.     This contains declarations for types and all producer
  18.     and consumer functions.
  19.  
  20.     Function declarations are written on a single line each here
  21.     so one can use grep  to each declaration in its entirety.
  22.     The declarations are a little harder to read this way, but...
  23.  
  24. */
  25.  
  26. #if (_MIPS_SZLONG == 64)
  27. typedef int             Dwarf_Bool;         /* boolean type */
  28. typedef unsigned long   Dwarf_Off;          /* 4 or 8 byte file offset */
  29. typedef unsigned long   Dwarf_Unsigned;     /* 4 or 8 byte unsigned value */
  30. typedef unsigned short  Dwarf_Half;         /* 2 byte unsigned value */
  31. typedef unsigned char   Dwarf_Small;        /* 1 byte unsigned value */
  32. typedef signed long     Dwarf_Signed;       /* 4 or 8 byte signed value */
  33. typedef unsigned long   Dwarf_Addr;         /* target memory address */
  34. #else /* 32-bit */
  35. typedef int                 Dwarf_Bool;     /* boolean type */
  36. typedef unsigned long long  Dwarf_Off;      /* 4 or 8 byte file offset */
  37. typedef unsigned long long  Dwarf_Unsigned; /* 4 or 8 byte unsigned value*/
  38. typedef unsigned short      Dwarf_Half;     /* 2 byte unsigned value */
  39. typedef unsigned char       Dwarf_Small;    /* 1 byte unsigned value */
  40. typedef signed long long    Dwarf_Signed;   /* 4 or 8 byte signed value */
  41. typedef unsigned long long  Dwarf_Addr;     /* target memory address */
  42. #endif
  43. typedef void*        Dwarf_Ptr;          /* host machine pointer */
  44.  
  45. /* uninterpreted block of data
  46. */
  47. typedef struct {
  48.         Dwarf_Unsigned  bl_len;         /* length of block */
  49.         Dwarf_Ptr       bl_data;        /* uninterpreted data */
  50. } Dwarf_Block;
  51.  
  52.  
  53. /* location record
  54. */
  55. typedef struct {
  56.         Dwarf_Small     lr_atom;        /* location operation */
  57.         Dwarf_Unsigned  lr_number;      /* operand */
  58.     Dwarf_Unsigned  lr_number2;     /* for OP_BREGx */
  59.     Dwarf_Unsigned  lr_offset;      /* offset in locexpr for OP_BRA etc */
  60. } Dwarf_Loc;
  61.  
  62.  
  63. /* location description
  64. */
  65. typedef struct {
  66.         Dwarf_Addr      ld_lopc;        /* beginning of active range */ 
  67.         Dwarf_Addr      ld_hipc;        /* end of active range */
  68.         Dwarf_Half      ld_cents;       /* count of location records */
  69.         Dwarf_Loc*      ld_s;           /* pointer to list of same */
  70. } Dwarf_Locdesc;
  71.  
  72. /* Frame description instructions expanded.
  73. */
  74. typedef struct {
  75.         Dwarf_Small     fp_base_op;
  76.         Dwarf_Small     fp_extended_op;
  77.         Dwarf_Half      fp_register;
  78.         Dwarf_Unsigned  fp_offset;
  79.         Dwarf_Off       fp_instr_offset;
  80. } Dwarf_Frame_Op;
  81.  
  82.  
  83. /* Opaque types for Consumer Library. */
  84. typedef struct Dwarf_Debug_s*      Dwarf_Debug;
  85. typedef struct Dwarf_Die_s*        Dwarf_Die;
  86. typedef struct Dwarf_Line_s*       Dwarf_Line;
  87. typedef struct Dwarf_Global_s*     Dwarf_Global;
  88. typedef struct Dwarf_Func_s*       Dwarf_Func;
  89. typedef struct Dwarf_Type_s*       Dwarf_Type;
  90. typedef struct Dwarf_Var_s*        Dwarf_Var;
  91. typedef struct Dwarf_Weak_s*       Dwarf_Weak;
  92. typedef struct Dwarf_Error_s*      Dwarf_Error;
  93. typedef struct Dwarf_Attribute_s*  Dwarf_Attribute;
  94. typedef struct Dwarf_Abbrev_s*       Dwarf_Abbrev;
  95. typedef struct Dwarf_Fde_s*         Dwarf_Fde;
  96. typedef struct Dwarf_Cie_s*         Dwarf_Cie;
  97. typedef struct Dwarf_Arange_s*       Dwarf_Arange;
  98.  
  99. #if 0
  100. /* Unused Opaque types */
  101. typedef struct Dwarf_Subscript_s*  Dwarf_Subscript;
  102. typedef struct Dwarf_Expr_s*       Dwarf_Expr;
  103. #endif
  104.  
  105. /* Opaque types for Producer Library. */
  106. typedef struct Dwarf_P_Debug_s*           Dwarf_P_Debug;
  107. typedef struct Dwarf_P_Die_s*           Dwarf_P_Die;
  108. typedef struct Dwarf_P_Attribute_s*    Dwarf_P_Attribute;
  109. typedef struct Dwarf_P_Fde_s*        Dwarf_P_Fde;
  110. typedef struct Dwarf_P_Expr_s*        Dwarf_P_Expr;
  111. typedef Dwarf_Unsigned                Dwarf_Tag;
  112.  
  113.  
  114. /* error handler function
  115. */
  116. typedef void  (*Dwarf_Handler)(Dwarf_Error /*error*/, Dwarf_Ptr /*errarg*/); 
  117.  
  118.  
  119. /* 
  120.     Dwarf_dealloc() alloc_type arguments.
  121.     Argument points to:
  122. */
  123. #define DW_DLA_STRING          0x01     /* char* */
  124. #define DW_DLA_LOC             0x02     /* Dwarf_Loc */
  125. #define DW_DLA_LOCDESC         0x03     /* Dwarf_Locdesc */
  126. #define DW_DLA_ELLIST          0x04     /* Dwarf_Ellist (not used)*/
  127. #define DW_DLA_BOUNDS          0x05     /* Dwarf_Bounds (not used) */
  128. #define DW_DLA_BLOCK           0x06     /* Dwarf_Block */
  129. #define DW_DLA_DEBUG           0x07     /* Dwarf_Debug */
  130. #define DW_DLA_DIE             0x08     /* Dwarf_Die */
  131. #define DW_DLA_LINE            0x09     /* Dwarf_Line */
  132. #define DW_DLA_ATTR            0x0a     /* Dwarf_Attribute */
  133. #define DW_DLA_TYPE            0x0b     /* Dwarf_Type  (not used) */
  134. #define DW_DLA_SUBSCR          0x0c     /* Dwarf_Subscr (not used) */
  135. #define DW_DLA_GLOBAL          0x0d     /* Dwarf_Global */
  136. #define DW_DLA_ERROR           0x0e     /* Dwarf_Error */
  137. #define DW_DLA_LIST            0x0f     /* a list */
  138. #define DW_DLA_LINEBUF         0x10     /* Dwarf_Line* (not used) */
  139. #define DW_DLA_ARANGE          0x11     /* Dwarf_Arange */
  140. #define DW_DLA_ABBREV        0x12      /* Dwarf_Abbrev */
  141. #define DW_DLA_FRAME_OP        0x13      /* Dwarf_Frame_Op */
  142. #define DW_DLA_CIE        0x14     /* Dwarf_Cie */
  143. #define DW_DLA_FDE        0x15     /* Dwarf_Fde */
  144. #define DW_DLA_LOC_BLOCK    0x16     /* Dwarf_Loc Block (not used) */
  145. #define DW_DLA_FRAME_BLOCK    0x17     /* Dwarf_Frame Block (not used) */
  146. #define DW_DLA_FUNC        0x18     /* Dwarf_Func */
  147. #define DW_DLA_TYPENAME        0x19     /* Dwarf_Type */
  148. #define DW_DLA_VAR        0x1a     /* Dwarf_Var */
  149. #define DW_DLA_WEAK        0x1b     /* Dwarf_Weak */
  150. #define DW_DLA_ADDR        0x1c     /* Dwarf_Addr sized entries */
  151.  
  152.  
  153. /* dwarf_init() access arguments
  154. */
  155. #define DW_DLC_READ        0        /* read only access */
  156. #define DW_DLC_WRITE       1        /* write only access */
  157. #define DW_DLC_RDWR        2        /* read/write access NOT SUPPORTED*/
  158.  
  159. /* dwarf_init() access flag modifiers
  160. */
  161. #define DW_DLC_SIZE_64     0x40000000 /* 32-bit target */
  162. #define DW_DLC_SIZE_32     0x20000000 /* 64-bit target */
  163.  
  164. /* dwarf_pcline() slide arguments
  165. */
  166. #define DW_DLS_BACKWARD   -1       /* slide backward to find line */
  167. #define DW_DLS_NOSLIDE     0       /* match exactly without sliding */ 
  168. #define DW_DLS_FORWARD     1       /* slide forward to find line */
  169.  
  170. /* libdwarf error numbers
  171. */
  172. #define DW_DLE_NE          0     /* no error */ 
  173. #define DW_DLE_VMM         1     /* dwarf format/library version mismatch */
  174. #define DW_DLE_MAP         2     /* memory map failure */
  175. #define DW_DLE_LEE         3     /* libelf error */
  176. #define DW_DLE_NDS         4     /* no debug section */
  177. #define DW_DLE_NLS         5     /* no line section */
  178. #define DW_DLE_ID          6     /* invalid descriptor for query */
  179. #define DW_DLE_IOF         7     /* I/O failure */
  180. #define DW_DLE_MAF         8     /* memory allocation failure */
  181. #define DW_DLE_IA          9     /* invalid argument */ 
  182. #define DW_DLE_MDE         10     /* mangled debugging entry */
  183. #define DW_DLE_MLE         11     /* mangled line number entry */
  184. #define DW_DLE_FNO         12     /* file not open */
  185. #define DW_DLE_FNR         13     /* file not a regular file */
  186. #define DW_DLE_FWA         14     /* file open with wrong access */
  187. #define DW_DLE_NOB         15     /* not an object file */
  188. #define DW_DLE_MOF         16     /* mangled object file header */
  189. #define DW_DLE_EOLL        17     /* end of location list entries */
  190. #define DW_DLE_NOLL        18     /* no location list section */
  191. #define DW_DLE_BADOFF      19     /* Invalid offset */
  192. #define DW_DLE_EOS         20     /* end of section  */
  193. #define DW_DLE_ATRUNC      21     /* abbreviations section appears truncated*/
  194. #define DW_DLE_BADBITC     22     /* Address size passed to dwarf bad*/
  195.                     /* It is not an allowed size (64 or 32) */
  196.     /* Error codes defined by the current Libdwarf Implementation. */
  197. #define DW_DLE_DBG_ALLOC                        23
  198. #define DW_DLE_FSTAT_ERROR                      24
  199. #define DW_DLE_FSTAT_MODE_ERROR                 25
  200. #define DW_DLE_INIT_ACCESS_WRONG                26
  201. #define DW_DLE_ELF_BEGIN_ERROR                  27
  202. #define DW_DLE_ELF_GETEHDR_ERROR                28
  203. #define DW_DLE_ELF_GETSHDR_ERROR                29
  204. #define DW_DLE_ELF_STRPTR_ERROR                 30
  205. #define DW_DLE_DEBUG_INFO_DUPLICATE             31
  206. #define DW_DLE_DEBUG_INFO_NULL                  32
  207. #define DW_DLE_DEBUG_ABBREV_DUPLICATE           33
  208. #define DW_DLE_DEBUG_ABBREV_NULL                34
  209. #define DW_DLE_DEBUG_ARANGES_DUPLICATE          35
  210. #define DW_DLE_DEBUG_ARANGES_NULL               36
  211. #define DW_DLE_DEBUG_LINE_DUPLICATE             37
  212. #define DW_DLE_DEBUG_LINE_NULL                  38
  213. #define DW_DLE_DEBUG_LOC_DUPLICATE              39
  214. #define DW_DLE_DEBUG_LOC_NULL                   40
  215. #define DW_DLE_DEBUG_MACINFO_DUPLICATE          41
  216. #define DW_DLE_DEBUG_MACINFO_NULL               42
  217. #define DW_DLE_DEBUG_PUBNAMES_DUPLICATE         43
  218. #define DW_DLE_DEBUG_PUBNAMES_NULL              44
  219. #define DW_DLE_DEBUG_STR_DUPLICATE              45
  220. #define DW_DLE_DEBUG_STR_NULL                   46
  221. #define DW_DLE_CU_LENGTH_ERROR                  47
  222. #define DW_DLE_VERSION_STAMP_ERROR              48
  223. #define DW_DLE_ABBREV_OFFSET_ERROR              49
  224. #define DW_DLE_ADDRESS_SIZE_ERROR               50
  225. #define DW_DLE_DEBUG_INFO_PTR_NULL              51
  226. #define DW_DLE_DIE_NULL                         52
  227. #define DW_DLE_STRING_OFFSET_BAD                53
  228. #define DW_DLE_DEBUG_LINE_LENGTH_BAD            54
  229. #define DW_DLE_LINE_PROLOG_LENGTH_BAD           55
  230. #define DW_DLE_LINE_NUM_OPERANDS_BAD            56
  231. #define DW_DLE_LINE_SET_ADDR_ERROR              57
  232. #define DW_DLE_LINE_EXT_OPCODE_BAD              58
  233. #define DW_DLE_DWARF_LINE_NULL                  59
  234. #define DW_DLE_INCL_DIR_NUM_BAD                 60
  235. #define DW_DLE_LINE_FILE_NUM_BAD                61
  236. #define DW_DLE_ALLOC_FAIL                       62
  237. #define DW_DLE_NO_CALLBACK_FUNC                63
  238. #define DW_DLE_SECT_ALLOC                64
  239. #define DW_DLE_FILE_ENTRY_ALLOC                65
  240. #define DW_DLE_LINE_ALLOC                66
  241. #define DW_DLE_FPGM_ALLOC                67
  242. #define DW_DLE_INCDIR_ALLOC                68
  243. #define DW_DLE_STRING_ALLOC                69
  244. #define DW_DLE_CHUNK_ALLOC                70
  245. #define DW_DLE_BYTEOFF_ERR                71
  246. #define    DW_DLE_CIE_ALLOC                72
  247. #define DW_DLE_FDE_ALLOC                73
  248. #define DW_DLE_REGNO_OVFL                74
  249. #define DW_DLE_CIE_OFFS_ALLOC                75
  250. #define DW_DLE_WRONG_ADDRESS                76
  251. #define DW_DLE_EXTRA_NEIGHBORS                77
  252. #define    DW_DLE_WRONG_TAG                78
  253. #define DW_DLE_DIE_ALLOC                79
  254. #define DW_DLE_PARENT_EXISTS                80
  255. #define DW_DLE_DBG_NULL                         81
  256. #define DW_DLE_DEBUGLINE_ERROR                82
  257. #define DW_DLE_DEBUGFRAME_ERROR                83
  258. #define DW_DLE_DEBUGINFO_ERROR                84
  259. #define DW_DLE_ATTR_ALLOC                85
  260. #define DW_DLE_ABBREV_ALLOC                86
  261. #define DW_DLE_OFFSET_UFLW                87
  262. #define DW_DLE_ELF_SECT_ERR                88
  263. #define DW_DLE_DEBUG_FRAME_LENGTH_BAD            89
  264. #define DW_DLE_FRAME_VERSION_BAD            90
  265. #define DW_DLE_CIE_RET_ADDR_REG_ERROR            91
  266. #define DW_DLE_FDE_NULL                    92
  267. #define DW_DLE_FDE_DBG_NULL                93
  268. #define DW_DLE_CIE_NULL                    94
  269. #define DW_DLE_CIE_DBG_NULL                95
  270. #define DW_DLE_FRAME_TABLE_COL_BAD            96
  271. #define DW_DLE_PC_NOT_IN_FDE_RANGE            97
  272. #define DW_DLE_CIE_INSTR_EXEC_ERROR            98
  273. #define DW_DLE_FRAME_INSTR_EXEC_ERROR            99
  274. #define DW_DLE_FDE_PTR_NULL                100
  275. #define DW_DLE_RET_OP_LIST_NULL                101
  276. #define DW_DLE_LINE_CONTEXT_NULL            102
  277. #define DW_DLE_DBG_NO_CU_CONTEXT            103
  278. #define DW_DLE_DIE_NO_CU_CONTEXT            104
  279. #define DW_DLE_FIRST_DIE_NOT_CU                105
  280. #define DW_DLE_NEXT_DIE_PTR_NULL            106
  281. #define DW_DLE_DEBUG_FRAME_DUPLICATE            107
  282. #define DW_DLE_DEBUG_FRAME_NULL                108
  283. #define DW_DLE_ABBREV_DECODE_ERROR            109
  284. #define DW_DLE_DWARF_ABBREV_NULL        110
  285. #define DW_DLE_ATTR_NULL                111
  286. #define DW_DLE_DIE_BAD                    112
  287. #define DW_DLE_DIE_ABBREV_BAD                113
  288. #define DW_DLE_ATTR_FORM_BAD                114
  289. #define DW_DLE_ATTR_NO_CU_CONTEXT            115
  290. #define DW_DLE_ATTR_FORM_SIZE_BAD            116
  291. #define DW_DLE_ATTR_DBG_NULL                117
  292. #define DW_DLE_BAD_REF_FORM                118
  293. #define DW_DLE_ATTR_FORM_OFFSET_BAD            119
  294. #define DW_DLE_LINE_OFFSET_BAD                120
  295. #define DW_DLE_DEBUG_STR_OFFSET_BAD            121
  296. #define DW_DLE_STRING_PTR_NULL                122
  297. #define DW_DLE_PUBNAMES_VERSION_ERROR            123
  298. #define DW_DLE_PUBNAMES_LENGTH_BAD            124
  299. #define DW_DLE_GLOBAL_NULL                125
  300. #define DW_DLE_GLOBAL_CONTEXT_NULL            126
  301. #define DW_DLE_DIR_INDEX_BAD                127
  302. #define DW_DLE_LOC_EXPR_BAD                128
  303. #define DW_DLE_DIE_LOC_EXPR_BAD                129
  304. #define DW_DLE_ADDR_ALLOC                130
  305. #define DW_DLE_OFFSET_BAD                131
  306. #define DW_DLE_MAKE_CU_CONTEXT_FAIL            132
  307. #define DW_DLE_REL_ALLOC                133
  308. #define DW_DLE_ARANGE_OFFSET_BAD            134
  309. #define DW_DLE_SEGMENT_SIZE_BAD                135
  310. #define DW_DLE_ARANGE_LENGTH_BAD            136
  311. #define DW_DLE_ARANGE_DECODE_ERROR            137
  312. #define DW_DLE_ARANGES_NULL                138
  313. #define DW_DLE_ARANGE_NULL                139
  314. #define DW_DLE_NO_FILE_NAME                140
  315. #define DW_DLE_NO_COMP_DIR                141
  316. #define DW_DLE_CU_ADDRESS_SIZE_BAD            142
  317. #define DW_DLE_INPUT_ATTR_BAD                143
  318. #define DW_DLE_EXPR_NULL                144
  319. #define DW_DLE_BAD_EXPR_OPCODE                145
  320. #define DW_DLE_EXPR_LENGTH_BAD                146
  321. #define DW_DLE_MULTIPLE_RELOC_IN_EXPR            147
  322. #define DW_DLE_ELF_GETIDENT_ERROR            148
  323. #define DW_DLE_NO_AT_MIPS_FDE                149
  324. #define DW_DLE_NO_CIE_FOR_FDE                150
  325. #define DW_DLE_DIE_ABBREV_LIST_NULL            151
  326. #define DW_DLE_DEBUG_FUNCNAMES_DUPLICATE        152
  327. #define DW_DLE_DEBUG_FUNCNAMES_NULL            153
  328. #define DW_DLE_DEBUG_FUNCNAMES_VERSION_ERROR    154
  329. #define DW_DLE_DEBUG_FUNCNAMES_LENGTH_BAD       155
  330. #define DW_DLE_FUNC_NULL                156
  331. #define DW_DLE_FUNC_CONTEXT_NULL            157
  332. #define DW_DLE_DEBUG_TYPENAMES_DUPLICATE        158
  333. #define DW_DLE_DEBUG_TYPENAMES_NULL            159
  334. #define DW_DLE_DEBUG_TYPENAMES_VERSION_ERROR    160
  335. #define DW_DLE_DEBUG_TYPENAMES_LENGTH_BAD       161
  336. #define DW_DLE_TYPE_NULL                162
  337. #define DW_DLE_TYPE_CONTEXT_NULL            163
  338. #define DW_DLE_DEBUG_VARNAMES_DUPLICATE            164
  339. #define DW_DLE_DEBUG_VARNAMES_NULL            165
  340. #define DW_DLE_DEBUG_VARNAMES_VERSION_ERROR     166
  341. #define DW_DLE_DEBUG_VARNAMES_LENGTH_BAD        167
  342. #define DW_DLE_VAR_NULL                    168
  343. #define DW_DLE_VAR_CONTEXT_NULL                169
  344. #define DW_DLE_DEBUG_WEAKNAMES_DUPLICATE        170
  345. #define DW_DLE_DEBUG_WEAKNAMES_NULL            171
  346. #define DW_DLE_DEBUG_WEAKNAMES_VERSION_ERROR    172
  347. #define DW_DLE_DEBUG_WEAKNAMES_LENGTH_BAD       173
  348. #define DW_DLE_WEAK_NULL                174
  349. #define DW_DLE_WEAK_CONTEXT_NULL            175
  350. #define DW_DLE_LOCDESC_COUNT_WRONG              176
  351.     /* MUST EQUAL LAST ERROR NUMBER */
  352. #define DW_DLE_LAST                    176
  353. #define DW_DLE_LO_USER     0x10000
  354.  
  355.         /* taken as meaning 'undefined value', this is not
  356.            a column or register number.
  357.            Only present at libdwarf runtime. Never on disk.
  358.        DW_FRAME_* Values present on disk are in dwarf.h
  359.         */
  360. #define DW_FRAME_UNDEFINED_VAL          1034
  361.  
  362.         /* taken as meaning 'same value' as caller had, not a column
  363.            or register number
  364.            Only present at libdwarf runtime. Never on disk.
  365.        DW_FRAME_* Values present on disk are in dwarf.h
  366.         */
  367. #define DW_FRAME_SAME_VAL               1035
  368.  
  369.  
  370.  
  371. /* error return values  
  372. */
  373. #define DW_DLV_BADADDR     (~(Dwarf_Addr)0)   
  374.     /* for functions returning target address */
  375.  
  376. #define DW_DLV_NOCOUNT     ((Dwarf_Signed)-1) 
  377.     /* for functions returning count */
  378.  
  379. #define DW_DLV_BADOFFSET   (~(Dwarf_Off)0)    
  380.     /* for functions returning offset */
  381.  
  382. /* standard return values for functions */
  383. #define DW_DLV_NO_ENTRY -1
  384. #define DW_DLV_OK        0
  385. #define DW_DLV_ERROR     1
  386.  
  387.  
  388.  
  389. /*===========================================================================*/
  390. /*  Dwarf consumer interface initialization and termination operations */
  391.  
  392. /* non-elf initialization */
  393. int dwarf_init ( 
  394.     int         /*fd*/, 
  395.     Dwarf_Unsigned     /*access*/, 
  396.     Dwarf_Handler     /*errhand*/, 
  397.     Dwarf_Ptr         /*errarg*/, 
  398.     Dwarf_Debug      *  /*dbg*/,
  399.     Dwarf_Error*     /*error*/
  400. );
  401.  
  402. /* elf intialization */
  403. int dwarf_elf_init ( 
  404.     Elf*         /*elf*/, 
  405.     Dwarf_Unsigned     /*access*/, 
  406.     Dwarf_Handler     /*errhand*/, 
  407.     Dwarf_Ptr         /*errarg*/, 
  408.     Dwarf_Debug      *  /*dbg*/,
  409.     Dwarf_Error*     /*error*/
  410. );
  411.  
  412. /* Undocumented function for memory allocator. */
  413. void dwarf_print_memory_stats (
  414.     Dwarf_Debug         /*dbg*/
  415. );
  416.  
  417. int dwarf_get_elf (
  418.     Dwarf_Debug        /*dbg*/,
  419.     Elf **              /*return_elfptr*/,
  420.     Dwarf_Error*    /*error*/
  421. );
  422.  
  423. int dwarf_finish ( 
  424.     Dwarf_Debug      /*dbg*/, 
  425.     Dwarf_Error*     /*error*/
  426. );
  427.  
  428. /* die traversal operations */
  429. int dwarf_next_cu_header (
  430.     Dwarf_Debug      /*dbg*/, 
  431.     Dwarf_Unsigned*     /*cu_header_length*/, 
  432.     Dwarf_Half*         /*version_stamp*/, 
  433.     Dwarf_Off*      /*abbrev_offset*/, 
  434.     Dwarf_Half*     /*address_size*/, 
  435.     Dwarf_Unsigned*     /*next_cu_header_offset*/,
  436.     Dwarf_Error*     /*error*/
  437. );
  438.  
  439. int dwarf_siblingof ( 
  440.     Dwarf_Debug     /*dbg*/, 
  441.     Dwarf_Die         /*die*/, 
  442.     Dwarf_Die*          /*return_siblingdie*/,
  443.     Dwarf_Error*     /*error*/
  444. );
  445.  
  446. int dwarf_child (
  447.     Dwarf_Die         /*die*/, 
  448.     Dwarf_Die*          /*return_childdie*/,
  449.     Dwarf_Error*     /*error*/
  450. );
  451.  
  452. /* finding die given offset */
  453. int dwarf_offdie (
  454.     Dwarf_Debug     /*dbg*/, 
  455.     Dwarf_Off         /*offset*/, 
  456.     Dwarf_Die*          /*return_die*/,
  457.     Dwarf_Error*     /*error*/
  458. );
  459.  
  460. /* higher level functions (Unimplemented) */
  461. int dwarf_pcfile (
  462.     Dwarf_Debug     /*dbg*/, 
  463.     Dwarf_Addr         /*pc*/, 
  464.     Dwarf_Die*          /*return_die*/,
  465.     Dwarf_Error*     /*error*/
  466. );
  467.  
  468. /* Unimplemented */
  469. int dwarf_pcsubr (
  470.     Dwarf_Debug     /*dbg*/, 
  471.     Dwarf_Addr         /*pc*/, 
  472.     Dwarf_Die*          /*return_die*/,
  473.     Dwarf_Error*     /*error*/
  474. );
  475.  
  476. /* Unimplemented */
  477. int dwarf_pcscope (
  478.     Dwarf_Debug     /*dbg*/, 
  479.     Dwarf_Addr         /*pc*/, 
  480.     Dwarf_Die*          /*return_die*/,
  481.     Dwarf_Error*     /*error*/
  482. );
  483.  
  484. /* operations on DIEs */
  485. int dwarf_tag (
  486.     Dwarf_Die         /*die*/, 
  487.     Dwarf_Half*            /*return_tag*/,
  488.     Dwarf_Error*     /*error*/
  489. );
  490.  
  491. /* utility? */
  492. int dwarf_dieoffset (
  493.     Dwarf_Die         /*die*/, 
  494.     Dwarf_Off*          /*return_offset*/,
  495.     Dwarf_Error*     /*error*/
  496. );
  497.  
  498. int dwarf_die_CU_offset (
  499.     Dwarf_Die           /*die*/,
  500.     Dwarf_Off*          /*return_offset*/,
  501.     Dwarf_Error*    /*error*/
  502. );
  503.  
  504. int dwarf_attr (
  505.     Dwarf_Die         /*die*/, 
  506.     Dwarf_Half         /*attr*/, 
  507.     Dwarf_Attribute *   /*returned_attr*/,
  508.     Dwarf_Error*     /*error*/
  509. );
  510.  
  511. int dwarf_diename (
  512.     Dwarf_Die         /*die*/, 
  513.     char   **           /*returned_name*/,
  514.     Dwarf_Error*     /*error*/
  515. );
  516.  
  517. /* convenience functions, alternative to using dwarf_attrlist() */
  518. int dwarf_hasattr (
  519.     Dwarf_Die         /*die*/, 
  520.     Dwarf_Half         /*attr*/, 
  521.     Dwarf_Bool     *    /*returned_bool*/,
  522.     Dwarf_Error*     /*error*/
  523. );
  524.  
  525. int dwarf_loclist (
  526.     Dwarf_Attribute     /*attr*/, 
  527.     Dwarf_Locdesc**     /*llbuf*/, 
  528.     Dwarf_Signed *      /*locCount*/,
  529.     Dwarf_Error*     /*error*/
  530. );
  531.  
  532. /* Unimplemented */
  533. int dwarf_stringlen ( 
  534.     Dwarf_Die         /*die*/, 
  535.     Dwarf_Locdesc **    /*returned_locdesc*/,
  536.     Dwarf_Error*     /*error*/
  537. );
  538.  
  539. /* Unimplemented */
  540. int dwarf_subscrcnt (
  541.     Dwarf_Die         /*die*/, 
  542.     Dwarf_Signed *      /*returned_count*/,
  543.     Dwarf_Error*     /*error*/
  544. );
  545.  
  546. /* Unimplemented */
  547. int dwarf_nthsubscr (
  548.     Dwarf_Die         /*die*/, 
  549.     Dwarf_Unsigned     /*ssndx*/, 
  550.     Dwarf_Die *         /*returned_die*/,
  551.     Dwarf_Error*     /*error*/
  552. );
  553.  
  554. int dwarf_lowpc (
  555.     Dwarf_Die         /*die*/, 
  556.     Dwarf_Addr  *       /*returned_addr*/,
  557.     Dwarf_Error*     /*error*/
  558. );
  559.  
  560. int dwarf_highpc (
  561.     Dwarf_Die         /*die*/, 
  562.     Dwarf_Addr  *       /*returned_addr*/,
  563.     Dwarf_Error*     /*error*/
  564. );
  565.  
  566. int dwarf_bytesize (
  567.     Dwarf_Die         /*die*/, 
  568.     Dwarf_Unsigned *      /*returned_size*/,
  569.     Dwarf_Error*     /*error*/
  570. );
  571.  
  572. /* Unimplemented */
  573. int dwarf_isbitfield (
  574.     Dwarf_Die         /*die*/, 
  575.     Dwarf_Bool  *       /*returned_bool*/,
  576.     Dwarf_Error*     /*error*/
  577. );
  578.  
  579. int dwarf_bitsize (
  580.     Dwarf_Die         /*die*/, 
  581.     Dwarf_Unsigned *    /*returned_size*/,
  582.     Dwarf_Error*     /*error*/
  583. );
  584.  
  585. int dwarf_bitoffset (
  586.     Dwarf_Die         /*die*/, 
  587.     Dwarf_Unsigned *    /*returned_offset*/,
  588.     Dwarf_Error*     /*error*/
  589. );
  590.  
  591. int dwarf_srclang (
  592.     Dwarf_Die         /*die*/, 
  593.     Dwarf_Unsigned *    /*returned_lang*/,
  594.     Dwarf_Error*     /*error*/
  595. );
  596.  
  597. int dwarf_arrayorder (
  598.     Dwarf_Die         /*die*/, 
  599.     Dwarf_Unsigned *    /*returned_order*/,
  600.     Dwarf_Error*     /*error*/
  601. );
  602. /* end of convenience function list */
  603.  
  604. /* this is the main interface to attributes of a DIE */
  605. int dwarf_attrlist (
  606.     Dwarf_Die         /*die*/, 
  607.     Dwarf_Attribute**     /*attrbuf*/, 
  608.     Dwarf_Signed   *    /*attrcount*/,
  609.     Dwarf_Error*     /*error*/
  610. );
  611.  
  612. /* query operations for attributes */
  613. int dwarf_hasform (
  614.     Dwarf_Attribute     /*attr*/, 
  615.     Dwarf_Half         /*form*/, 
  616.     Dwarf_Bool *        /*returned_bool*/,
  617.     Dwarf_Error*     /*error*/
  618. );
  619.  
  620. int dwarf_whatform (
  621.     Dwarf_Attribute     /*attr*/, 
  622.     Dwarf_Half *        /*returned_form*/,
  623.     Dwarf_Error*     /*error*/
  624. );
  625.  
  626. int dwarf_whatattr (
  627.     Dwarf_Attribute     /*attr*/, 
  628.     Dwarf_Half *        /*returned_attr_num*/,
  629.     Dwarf_Error*     /*error*/
  630. );
  631.  
  632. /* 
  633.     The following are concerned with the Primary Interface: getting
  634.     the actual data values. One function per 'kind' of FORM.
  635. */
  636. int dwarf_formref (
  637.     Dwarf_Attribute     /*attr*/, 
  638.     Dwarf_Off*          /*return_offset*/,
  639.     Dwarf_Error*     /*error*/
  640. );
  641.  
  642. int dwarf_formaddr (
  643.     Dwarf_Attribute     /*attr*/, 
  644.     Dwarf_Addr   *      /*returned_addr*/,
  645.     Dwarf_Error*     /*error*/
  646. );
  647.  
  648. int dwarf_formflag (
  649.     Dwarf_Attribute    /*attr*/,
  650.     Dwarf_Bool *        /*returned_bool*/,
  651.     Dwarf_Error*    /*error*/
  652. );
  653.  
  654. int dwarf_formudata (
  655.     Dwarf_Attribute     /*attr*/, 
  656.     Dwarf_Unsigned  *   /*returned_val*/,
  657.     Dwarf_Error*     /*error*/
  658. );
  659.  
  660. int dwarf_formsdata (
  661.     Dwarf_Attribute     /*attr*/, 
  662.     Dwarf_Signed  *     /*returned_val*/,
  663.     Dwarf_Error*     /*error*/
  664. );
  665.  
  666. int dwarf_formblock (
  667.     Dwarf_Attribute     /*attr*/, 
  668.     Dwarf_Block    **   /*returned_block*/,
  669.     Dwarf_Error*     /*error*/
  670. );
  671.  
  672. int dwarf_formstring (
  673.     Dwarf_Attribute     /*attr*/, 
  674.     char   **           /*returned_string*/,
  675.     Dwarf_Error*     /*error*/
  676. );
  677. /* end attribute query operations. */
  678.  
  679. /* line number operations */
  680. /* dwarf_srclines  is the normal interface */
  681. int dwarf_srclines (
  682.     Dwarf_Die         /*die*/, 
  683.     Dwarf_Line**     /*linebuf*/, 
  684.     Dwarf_Signed *      /*linecount*/,
  685.     Dwarf_Error*     /*error*/
  686. );
  687.  
  688. int dwarf_srcfiles (
  689.     Dwarf_Die         /*die*/, 
  690.     char***         /*srcfiles*/, 
  691.     Dwarf_Signed *      /*filecount*/,
  692.     Dwarf_Error*     /*error*/
  693. );
  694.  
  695. /* Unimplemented. */
  696. int dwarf_dieline (
  697.     Dwarf_Die         /*die*/, 
  698.     Dwarf_Line  *       /*returned_line*/,
  699.     Dwarf_Error*     /*error*/
  700. );
  701.  
  702. int dwarf_linebeginstatement (
  703.     Dwarf_Line         /*line*/, 
  704.     Dwarf_Bool  *       /*returned_bool*/,
  705.     Dwarf_Error*     /*error*/
  706. );
  707.  
  708. int dwarf_lineendsequence (
  709.     Dwarf_Line          /*line*/,
  710.     Dwarf_Bool  *       /*returned_bool*/,
  711.     Dwarf_Error*        /*error*/
  712. );
  713.  
  714. int dwarf_lineno (
  715.     Dwarf_Line         /*line*/, 
  716.     Dwarf_Unsigned *    /*returned_lineno*/,
  717.     Dwarf_Error*     /*error*/
  718. );
  719.  
  720. int dwarf_lineaddr (
  721.     Dwarf_Line         /*line*/, 
  722.     Dwarf_Addr *        /*returned_addr*/,
  723.     Dwarf_Error*     /*error*/
  724. );
  725.  
  726. int dwarf_lineoff (
  727.     Dwarf_Line         /*line*/, 
  728.     Dwarf_Signed  *     /*returned_lineoffset*/,
  729.     Dwarf_Error*     /*error*/
  730. );
  731.  
  732. int dwarf_linesrc (
  733.     Dwarf_Line         /*line*/, 
  734.     char   **           /*returned_name*/,
  735.     Dwarf_Error*     /*error*/
  736. );
  737.  
  738. int dwarf_lineblock (
  739.     Dwarf_Line         /*line*/, 
  740.     Dwarf_Bool  *       /*returned_bool*/,
  741.     Dwarf_Error*     /*error*/
  742. );
  743.  
  744. /* tertiary interface to line info */
  745. /* Unimplemented */
  746. int dwarf_pclines ( 
  747.     Dwarf_Debug     /*dbg*/, 
  748.     Dwarf_Addr         /*pc*/, 
  749.     Dwarf_Line**     /*linebuf*/, 
  750.     Dwarf_Signed *      /*linecount*/,
  751.     Dwarf_Signed     /*slide*/, 
  752.     Dwarf_Error*     /*error*/
  753. );
  754. /* end line number operations */
  755.  
  756. /* global name space operations (.debug_pubnames access) */
  757. int dwarf_get_globals (
  758.     Dwarf_Debug     /*dbg*/, 
  759.     Dwarf_Global**     /*globals*/, 
  760.     Dwarf_Signed *      /*number_of_globals*/,
  761.     Dwarf_Error*     /*error*/
  762. );
  763.  
  764. int dwarf_globname (
  765.     Dwarf_Global     /*glob*/, 
  766.     char   **           /*returned_name*/,
  767.     Dwarf_Error*     /*error*/
  768. );
  769.  
  770. int dwarf_global_die_offset (
  771.     Dwarf_Global     /*global*/, 
  772.     Dwarf_Off*          /*return_offset*/,
  773.     Dwarf_Error *     /*error*/
  774. );
  775.  
  776. int dwarf_global_cu_offset (
  777.     Dwarf_Global     /*global*/, 
  778.     Dwarf_Off*          /*return_offset*/,
  779.     Dwarf_Error*     /*error*/
  780. );
  781.  
  782. int dwarf_global_name_offsets (
  783.     Dwarf_Global     /*global*/, 
  784.     char   **           /*returned_name*/,
  785.     Dwarf_Off*         /*die_offset*/, 
  786.     Dwarf_Off*         /*cu_offset*/, 
  787.     Dwarf_Error*     /*error*/
  788. );
  789.  
  790. /* Static function name operations.  */
  791. int dwarf_get_funcs (
  792.     Dwarf_Debug        /*dbg*/,
  793.     Dwarf_Func**    /*funcs*/,
  794.     Dwarf_Signed *      /*number_of_funcs*/,
  795.     Dwarf_Error*    /*error*/
  796. );
  797.  
  798. int dwarf_funcname (
  799.     Dwarf_Func        /*func*/,
  800.     char   **           /*returned_name*/,
  801.     Dwarf_Error*    /*error*/
  802. );
  803.  
  804. int dwarf_func_die_offset (
  805.     Dwarf_Func        /*func*/,
  806.     Dwarf_Off*          /*return_offset*/,
  807.     Dwarf_Error*    /*error*/
  808. );
  809.  
  810. int dwarf_func_cu_offset (
  811.     Dwarf_Func        /*func*/,
  812.     Dwarf_Off*          /*return_offset*/,
  813.     Dwarf_Error*    /*error*/
  814. );
  815.  
  816. int dwarf_func_name_offsets (
  817.     Dwarf_Func        /*func*/,
  818.     char   **           /*returned_name*/,
  819.     Dwarf_Off*        /*die_offset*/,
  820.     Dwarf_Off*        /*cu_offset*/,
  821.     Dwarf_Error*    /*error*/
  822. );
  823.  
  824. /* User-defined type name operations.  */
  825. int dwarf_get_types (
  826.     Dwarf_Debug        /*dbg*/,
  827.     Dwarf_Type**    /*types*/,
  828.     Dwarf_Signed *      /*number_of_types*/,
  829.     Dwarf_Error*    /*error*/
  830. );
  831.  
  832. int dwarf_typename (
  833.     Dwarf_Type        /*type*/,
  834.     char   **           /*returned_name*/,
  835.     Dwarf_Error*    /*error*/
  836. );
  837.  
  838. int dwarf_type_die_offset (
  839.     Dwarf_Type        /*type*/,
  840.     Dwarf_Off*          /*return_offset*/,
  841.     Dwarf_Error*    /*error*/
  842. );
  843.  
  844. int dwarf_type_cu_offset (
  845.     Dwarf_Type        /*type*/,
  846.     Dwarf_Off*          /*return_offset*/,
  847.     Dwarf_Error*    /*error*/
  848. );
  849.  
  850. int dwarf_type_name_offsets (
  851.     Dwarf_Type        /*type*/,
  852.     char   **           /*returned_name*/,
  853.     Dwarf_Off*        /*die_offset*/,
  854.     Dwarf_Off*        /*cu_offset*/,
  855.     Dwarf_Error*    /*error*/
  856. );
  857.  
  858. /* File-scope static variable name operations.  */
  859. int dwarf_get_vars (
  860.     Dwarf_Debug        /*dbg*/,
  861.     Dwarf_Var**        /*vars*/,
  862.     Dwarf_Signed *      /*number_of_vars*/,
  863.     Dwarf_Error*    /*error*/
  864. );
  865.  
  866. int dwarf_varname (
  867.     Dwarf_Var        /*var*/,
  868.     char   **           /*returned_name*/,
  869.     Dwarf_Error*    /*error*/
  870. );
  871.  
  872. int dwarf_var_die_offset (
  873.     Dwarf_Var        /*var*/,
  874.     Dwarf_Off*          /*return_offset*/,
  875.     Dwarf_Error*    /*error*/
  876. );
  877.  
  878. int dwarf_var_cu_offset (
  879.     Dwarf_Var        /*var*/,
  880.     Dwarf_Off*          /*return_offset*/,
  881.     Dwarf_Error*    /*error*/
  882. );
  883.  
  884. int dwarf_var_name_offsets (
  885.     Dwarf_Var        /*var*/,
  886.     char   **           /*returned_name*/,
  887.     Dwarf_Off*        /*die_offset*/,
  888.     Dwarf_Off*        /*cu_offset*/,
  889.     Dwarf_Error*    /*error*/
  890. );
  891.  
  892. /* weak name operations.  */
  893. int dwarf_get_weaks (
  894.     Dwarf_Debug        /*dbg*/,
  895.     Dwarf_Weak**    /*weaks*/,
  896.     Dwarf_Signed *      /*number_of_weaks*/,
  897.     Dwarf_Error*    /*error*/
  898. );
  899.  
  900. int dwarf_weakname (
  901.     Dwarf_Weak        /*weak*/,
  902.     char   **           /*returned_name*/,
  903.     Dwarf_Error*    /*error*/
  904. );
  905.  
  906. int dwarf_weak_die_offset (
  907.     Dwarf_Weak        /*weak*/,
  908.     Dwarf_Off*          /*return_offset*/,
  909.     Dwarf_Error*    /*error*/
  910. );
  911.  
  912. int dwarf_weak_cu_offset (
  913.     Dwarf_Weak        /*weak*/,
  914.     Dwarf_Off*          /*return_offset*/,
  915.     Dwarf_Error*    /*error*/
  916. );
  917.  
  918. int dwarf_weak_name_offsets (
  919.     Dwarf_Weak        /*weak*/,
  920.     char   **           /*returned_name*/,
  921.     Dwarf_Off*        /*die_offset*/,
  922.     Dwarf_Off*        /*cu_offset*/,
  923.     Dwarf_Error*    /*error*/
  924. );
  925.  
  926. /* location list section operation.  (.debug_loc access) */
  927. /* Unimplemented. */
  928. int dwarf_get_loclist_entry (
  929.     Dwarf_Debug     /*dbg*/, 
  930.     Dwarf_Unsigned     /*offset*/, 
  931.     Dwarf_Addr*     /*hipc*/, 
  932.     Dwarf_Addr*     /*lopc*/, 
  933.     Dwarf_Ptr*         /*data*/, 
  934.     Dwarf_Unsigned*     /*entry_len*/, 
  935.     Dwarf_Unsigned*     /*next_entry*/, 
  936.     Dwarf_Error*     /*error*/
  937. );
  938.  
  939. /* abbreviation section operations */
  940. int dwarf_get_abbrev (
  941.     Dwarf_Debug     /*dbg*/, 
  942.     Dwarf_Unsigned     /*offset*/, 
  943.     Dwarf_Abbrev  *     /*returned_abbrev*/,
  944.     Dwarf_Unsigned*     /*length*/, 
  945.     Dwarf_Unsigned*     /*attr_count*/, 
  946.     Dwarf_Error*     /*error*/
  947. );
  948.  
  949. int dwarf_get_abbrev_tag (
  950.     Dwarf_Abbrev     /*abbrev*/, 
  951.     Dwarf_Half*        /*return_tag_number*/,
  952.     Dwarf_Error*     /*error*/
  953. );
  954.  
  955. int dwarf_get_abbrev_children_flag (
  956.     Dwarf_Abbrev     /*abbrev*/, 
  957.     Dwarf_Signed*        /*return_flag*/,
  958.     Dwarf_Error*     /*error*/
  959. );
  960.  
  961. int dwarf_get_abbrev_entry (
  962.     Dwarf_Abbrev      /*abbrev*/, 
  963.     Dwarf_Signed      /*index*/, 
  964.     Dwarf_Half  *       /*returned_attr_num*/,
  965.     Dwarf_Signed*     /*form*/, 
  966.     Dwarf_Off*        /*offset*/, 
  967.     Dwarf_Error*      /*error*/
  968. );
  969.  
  970. /* consumer string section operation */
  971. int dwarf_get_str (
  972.     Dwarf_Debug     /*dbg*/, 
  973.     Dwarf_Off        /*offset*/, 
  974.     char**         /*string*/, 
  975.     Dwarf_Signed *      /*strlen_of_string*/,
  976.     Dwarf_Error*      /*error*/
  977. );
  978.  
  979. /* consumer operations on frame info: .debug_frame */
  980. int dwarf_get_fde_list (
  981.     Dwarf_Debug     /*dbg*/, 
  982.     Dwarf_Cie**       /*cie_data*/, 
  983.     Dwarf_Signed*     /*cie_element_count*/, 
  984.     Dwarf_Fde**       /*fde_data*/, 
  985.     Dwarf_Signed*     /*fde_element_count*/, 
  986.     Dwarf_Error*     /*error*/
  987. );
  988.  
  989. int dwarf_get_fde_range (
  990.     Dwarf_Fde         /*fde*/, 
  991.     Dwarf_Addr*     /*low_pc*/, 
  992.     Dwarf_Unsigned*     /*func_length*/, 
  993.     Dwarf_Ptr*        /*fde_bytes*/, 
  994.     Dwarf_Unsigned*     /*fde_byte_length*/, 
  995.     Dwarf_Off*        /*cie_offset*/, 
  996.     Dwarf_Signed*      /*cie_index*/, 
  997.     Dwarf_Off*       /*fde_offset*/, 
  998.     Dwarf_Error*     /*error*/
  999. );
  1000.  
  1001. int dwarf_get_cie_info (
  1002.     Dwarf_Cie         /*cie*/, 
  1003.     Dwarf_Unsigned *    /*bytes_in_cie*/,
  1004.     Dwarf_Small*        /*version*/, 
  1005.     char        **      /*augmenter*/,
  1006.     Dwarf_Unsigned*     /*code_alignment_factor*/, 
  1007.     Dwarf_Signed*     /*data_alignment_factor*/, 
  1008.     Dwarf_Half*         /*return_address_register_rule*/, 
  1009.     Dwarf_Ptr*         /*initial_instructions*/, 
  1010.     Dwarf_Unsigned*      /*initial_instructions_length*/, 
  1011.     Dwarf_Error*     /*error*/
  1012. );
  1013.  
  1014. int dwarf_get_fde_info_for_reg (
  1015.     Dwarf_Fde         /*fde*/, 
  1016.     Dwarf_Half        /*table_column*/, 
  1017.     Dwarf_Addr        /*pc_requested*/, 
  1018.     Dwarf_Signed*       /*offset_relevant*/,
  1019.     Dwarf_Signed*     /*register*/,  
  1020.     Dwarf_Signed*     /*offset*/, 
  1021.     Dwarf_Addr*     /*row_pc*/, 
  1022.     Dwarf_Error*     /*error*/
  1023. );
  1024.  
  1025. int dwarf_get_fde_for_die (
  1026.     Dwarf_Debug     /*dbg*/, 
  1027.     Dwarf_Die         /*subr_die */, 
  1028.     Dwarf_Fde  *        /*returned_fde*/,
  1029.     Dwarf_Error*    /*error*/
  1030. );
  1031.  
  1032. int dwarf_get_fde_n (
  1033.     Dwarf_Fde*         /*fde_data*/, 
  1034.     Dwarf_Unsigned     /*fde_index*/, 
  1035.     Dwarf_Fde  *        /*returned_fde*/,
  1036.     Dwarf_Error*      /*error*/
  1037. );
  1038.  
  1039. int dwarf_get_fde_at_pc (
  1040.     Dwarf_Fde*      /*fde_data*/, 
  1041.     Dwarf_Addr         /*pc_of_interest*/, 
  1042.     Dwarf_Fde  *        /*returned_fde*/,
  1043.     Dwarf_Addr*     /*lopc*/, 
  1044.     Dwarf_Addr*     /*hipc*/, 
  1045.     Dwarf_Error*     /*error*/
  1046. );
  1047.  
  1048. int dwarf_expand_frame_instructions (
  1049.     Dwarf_Debug     /*dbg*/, 
  1050.     Dwarf_Ptr         /*instruction*/, 
  1051.     Dwarf_Unsigned      /*i_length*/, 
  1052.     Dwarf_Frame_Op**     /*returned_op_list*/, 
  1053.     Dwarf_Signed*       /*op_count*/,
  1054.     Dwarf_Error*     /*error*/
  1055. );
  1056.  
  1057. /* Operations on .debug_aranges. */
  1058. int dwarf_get_aranges (
  1059.     Dwarf_Debug     /*dbg*/, 
  1060.     Dwarf_Arange**     /*aranges*/, 
  1061.     Dwarf_Signed *      /*arange_count*/,
  1062.     Dwarf_Error*     /*error*/
  1063. );
  1064.  
  1065.  
  1066.  
  1067. int dwarf_get_arange (
  1068.     Dwarf_Arange*     /*aranges*/, 
  1069.     Dwarf_Unsigned     /*arange_count*/, 
  1070.     Dwarf_Addr         /*address*/, 
  1071.     Dwarf_Arange *      /*returned_arange*/,
  1072.     Dwarf_Error*     /*error*/
  1073. );
  1074.  
  1075. int dwarf_get_cu_die_offset (
  1076.     Dwarf_Arange     /*arange*/, 
  1077.     Dwarf_Off*          /*return_offset*/,
  1078.     Dwarf_Error*     /*error*/
  1079. );
  1080.  
  1081. int dwarf_get_arange_info (
  1082.     Dwarf_Arange     /*arange*/, 
  1083.     Dwarf_Addr*     /*start*/, 
  1084.     Dwarf_Unsigned*     /*length*/, 
  1085.     Dwarf_Off*         /*cu_die_offset*/, 
  1086.     Dwarf_Error*     /*error*/
  1087. );
  1088.  
  1089.  
  1090. /* utility operations */
  1091. Dwarf_Unsigned dwarf_errno (
  1092.     Dwarf_Error     /*error*/
  1093. );
  1094.  
  1095. char* dwarf_errmsg (
  1096.     Dwarf_Error     /*error*/
  1097. );
  1098.  
  1099. /* Unimplemented */
  1100. Dwarf_Handler dwarf_seterrhand (
  1101.     Dwarf_Debug     /*dbg*/, 
  1102.     Dwarf_Handler     /*errhand*/
  1103. );
  1104.  
  1105. /* Unimplemented */
  1106. Dwarf_Ptr dwarf_seterrarg (
  1107.     Dwarf_Debug     /*dbg*/, 
  1108.     Dwarf_Ptr         /*errarg*/
  1109. );
  1110.  
  1111. void dwarf_dealloc (
  1112.     Dwarf_Debug        /*dbg*/,
  1113.     void*         /*space*/, 
  1114.     Dwarf_Unsigned     /*type*/
  1115. );
  1116.  
  1117.  
  1118. /* DWARF Producer Interface */
  1119.  
  1120. typedef int (*Dwarf_Callback_Func) (
  1121.     char*         /*name*/, 
  1122.     int         /*size*/, 
  1123.     Dwarf_Unsigned     /*type*/,
  1124.     Dwarf_Unsigned     /*flags*/, 
  1125.     Dwarf_Unsigned     /*link*/, 
  1126.     Dwarf_Unsigned     /*info*/, 
  1127.     int*         /*sect name index*/, 
  1128.     int*         /*error*/
  1129. );
  1130.  
  1131. Dwarf_P_Debug dwarf_producer_init (
  1132.     Dwarf_Unsigned     /*creation_flags*/, 
  1133.     Dwarf_Callback_Func    /*func*/,
  1134.     Dwarf_Handler     /*errhand*/, 
  1135.     Dwarf_Ptr         /*errarg*/, 
  1136.     Dwarf_Error*     /*error*/
  1137. );
  1138.  
  1139. Dwarf_Signed dwarf_transform_to_disk_form (
  1140.     Dwarf_P_Debug     /*dbg*/,
  1141.     Dwarf_Error*     /*error*/
  1142. );
  1143.  
  1144. Dwarf_Ptr dwarf_get_section_bytes (
  1145.     Dwarf_P_Debug     /*dbg*/, 
  1146.     Dwarf_Signed     /*dwarf_section*/,
  1147.     Dwarf_Signed*     /*elf_section_index*/, 
  1148.     Dwarf_Unsigned*     /*length*/, 
  1149.     Dwarf_Error*     /*error*/
  1150. );
  1151.  
  1152. Dwarf_Unsigned dwarf_producer_finish (
  1153.     Dwarf_P_Debug    /*dbg*/, 
  1154.     Dwarf_Error*    /*error*/
  1155. );
  1156.  
  1157. /* Producer attribute addition functions. */
  1158. Dwarf_P_Attribute dwarf_add_AT_targ_address (
  1159.     Dwarf_P_Debug     /*dbg*/, 
  1160.     Dwarf_P_Die     /*ownerdie*/, 
  1161.     Dwarf_Half         /*attr*/, 
  1162.     Dwarf_Unsigned     /*pc_value*/, 
  1163.     Dwarf_Signed     /*sym_index*/, 
  1164.     Dwarf_Error*     /*error*/
  1165. );
  1166.  
  1167. Dwarf_P_Attribute dwarf_add_AT_unsigned_const (
  1168.     Dwarf_P_Debug     /*dbg*/, 
  1169.     Dwarf_P_Die     /*ownerdie*/, 
  1170.     Dwarf_Half         /*attr*/, 
  1171.     Dwarf_Unsigned     /*value*/, 
  1172.     Dwarf_Error*     /*error*/
  1173. );
  1174.  
  1175. Dwarf_P_Attribute dwarf_add_AT_signed_const (
  1176.     Dwarf_P_Debug     /*dbg*/, 
  1177.     Dwarf_P_Die     /*ownerdie*/, 
  1178.     Dwarf_Half         /*attr*/, 
  1179.     Dwarf_Signed     /*value*/, 
  1180.     Dwarf_Error*     /*error*/
  1181. );
  1182.  
  1183. Dwarf_P_Attribute dwarf_add_AT_reference (
  1184.     Dwarf_P_Debug     /*dbg*/, 
  1185.     Dwarf_P_Die     /*ownerdie*/, 
  1186.     Dwarf_Half         /*attr*/, 
  1187.     Dwarf_P_Die     /*otherdie*/, 
  1188.     Dwarf_Error*     /*error*/
  1189. );
  1190.  
  1191. Dwarf_P_Attribute dwarf_add_AT_const_value_string (
  1192.     Dwarf_P_Die     /*ownerdie*/, 
  1193.     char*         /*string_value*/, 
  1194.     Dwarf_Error*     /*error*/
  1195. );
  1196.  
  1197. Dwarf_P_Attribute dwarf_add_AT_location_expr (
  1198.     Dwarf_P_Debug    /*dbg*/, 
  1199.     Dwarf_P_Die     /*ownerdie*/, 
  1200.     Dwarf_Half         /*attr*/, 
  1201.     Dwarf_P_Expr     /*loc_expr*/, 
  1202.     Dwarf_Error*     /*error*/
  1203. );
  1204.  
  1205. Dwarf_P_Attribute dwarf_add_AT_string (
  1206.     Dwarf_P_Debug     /*dbg*/, 
  1207.     Dwarf_P_Die     /*ownerdie*/, 
  1208.     Dwarf_Half         /*attr*/, 
  1209.     char*         /*string*/, 
  1210.     Dwarf_Error*     /*error*/
  1211. );
  1212.  
  1213. Dwarf_P_Attribute dwarf_add_AT_flag ( 
  1214.     Dwarf_P_Debug    /*dbg*/, 
  1215.     Dwarf_P_Die     /*ownerdie*/, 
  1216.     Dwarf_Half         /*attr*/, 
  1217.     Dwarf_Small     /*flag*/, 
  1218.     Dwarf_Error*     /*error*/
  1219. );
  1220.  
  1221. Dwarf_P_Attribute dwarf_add_AT_producer (
  1222.     Dwarf_P_Die     /*ownerdie*/, 
  1223.     char*         /*producer_string*/, 
  1224.     Dwarf_Error*     /*error*/
  1225. );
  1226.  
  1227. Dwarf_P_Attribute dwarf_add_AT_const_value_signedint (
  1228.     Dwarf_P_Die     /*ownerdie*/, 
  1229.     Dwarf_Signed     /*signed_value*/, 
  1230.     Dwarf_Error*     /*error*/
  1231. );
  1232.  
  1233. Dwarf_P_Attribute dwarf_add_AT_const_value_unsignedint (
  1234.     Dwarf_P_Die        /*ownerdie*/, 
  1235.     Dwarf_Unsigned     /*unsigned_value*/, 
  1236.     Dwarf_Error*     /*error*/
  1237. );
  1238.  
  1239. Dwarf_P_Attribute dwarf_add_AT_comp_dir (
  1240.     Dwarf_P_Die     /*ownerdie*/, 
  1241.     char*         /*current_working_directory*/, 
  1242.     Dwarf_Error*     /*error*/
  1243. );
  1244.  
  1245. Dwarf_P_Attribute dwarf_add_AT_name (
  1246.     Dwarf_P_Die        /*die*/,
  1247.     char*         /*name*/,
  1248.     Dwarf_Error*     /*error*/
  1249. );
  1250.  
  1251. /* Producer line creation functions (.debug_line) */
  1252. Dwarf_Unsigned dwarf_add_directory_decl (
  1253.     Dwarf_P_Debug    /*dbg*/, 
  1254.     char*         /*name*/, 
  1255.     Dwarf_Error*    /*error*/
  1256. );
  1257.  
  1258. Dwarf_Unsigned dwarf_add_file_decl (
  1259.     Dwarf_P_Debug    /*dbg*/, 
  1260.     char*         /*name*/,
  1261.     Dwarf_Unsigned     /*dir_index*/, 
  1262.     Dwarf_Unsigned     /*time_last_modified*/, 
  1263.     Dwarf_Unsigned     /*length*/, 
  1264.     Dwarf_Error*    /*error*/
  1265. );
  1266.  
  1267. Dwarf_Unsigned dwarf_add_line_entry (
  1268.     Dwarf_P_Debug    /*dbg*/, 
  1269.     Dwarf_Unsigned     /*file_index*/, 
  1270.     Dwarf_Addr         /*code_address*/, 
  1271.     Dwarf_Unsigned     /*lineno*/, 
  1272.     Dwarf_Signed     /*column_number*/, 
  1273.     Dwarf_Bool         /*is_source_stmt_begin*/, 
  1274.     Dwarf_Bool         /*is_basic_block_begin*/, 
  1275.     Dwarf_Error*     /*error*/
  1276. );
  1277.  
  1278. Dwarf_Unsigned dwarf_lne_set_address (
  1279.     Dwarf_P_Debug    /*dbg*/, 
  1280.     Dwarf_Unsigned     /*offset*/, 
  1281.     Dwarf_Unsigned     /*symbol_index*/, 
  1282.     Dwarf_Error*     /*error*/
  1283. );
  1284.  
  1285. Dwarf_Unsigned dwarf_lne_end_sequence (
  1286.     Dwarf_P_Debug    /*dbg*/, 
  1287.     Dwarf_Addr        /*end_address*/,
  1288.     Dwarf_Error*     /*error*/
  1289. );
  1290.  
  1291. /* Producer .debug_frame functions */
  1292. Dwarf_Unsigned dwarf_add_frame_cie (
  1293.     Dwarf_P_Debug     /*dbg*/, 
  1294.     char*         /*augmenter*/, 
  1295.     Dwarf_Small     /*code_alignent_factor*/, 
  1296.     Dwarf_Small     /*data_alignment_factor*/, 
  1297.     Dwarf_Small     /*return_address_reg*/, 
  1298.     Dwarf_Ptr         /*initialization_bytes*/, 
  1299.     Dwarf_Unsigned     /*init_byte_len*/, 
  1300.     Dwarf_Error*     /*error*/
  1301. );
  1302.  
  1303. Dwarf_Unsigned dwarf_add_frame_fde (
  1304.     Dwarf_P_Debug     /*dbg*/,
  1305.     Dwarf_P_Fde     /*fde*/, 
  1306.     Dwarf_P_Die     /*corresponding subprogram die*/,
  1307.     Dwarf_Unsigned     /*cie_to_use*/, 
  1308.     Dwarf_Unsigned      /*virt_addr_of_described_code*/, 
  1309.     Dwarf_Unsigned      /*length_of_code*/, 
  1310.     Dwarf_Unsigned     /*symbol_index*/, 
  1311.     Dwarf_Error*     /*error*/
  1312. );
  1313.  
  1314. Dwarf_P_Fde dwarf_add_fde_inst (
  1315.     Dwarf_P_Fde     /*fde*/,
  1316.     Dwarf_Small     /*op*/, 
  1317.     Dwarf_Unsigned     /*val1*/, 
  1318.     Dwarf_Unsigned     /*val2*/, 
  1319.     Dwarf_Error*     /*error*/
  1320. );
  1321.  
  1322. Dwarf_P_Fde dwarf_new_fde (
  1323.     Dwarf_P_Debug    /*dbg*/, 
  1324.     Dwarf_Error*    /*error*/
  1325. );
  1326.  
  1327. Dwarf_P_Fde dwarf_fde_cfa_offset (
  1328.     Dwarf_P_Fde     /*fde*/, 
  1329.     Dwarf_Unsigned      /*register_number*/, 
  1330.     Dwarf_Signed        /*offset*/, 
  1331.     Dwarf_Error*     /*error*/
  1332. );
  1333.  
  1334. /* die creation & addition routines */
  1335. Dwarf_P_Die dwarf_new_die (
  1336.     Dwarf_P_Debug    /*dbg*/,
  1337.     Dwarf_Tag         /*tag*/,
  1338.     Dwarf_P_Die     /*parent*/, 
  1339.     Dwarf_P_Die     /*child*/, 
  1340.     Dwarf_P_Die     /*left */,
  1341.     Dwarf_P_Die     /*right*/,
  1342.     Dwarf_Error*    /*error*/
  1343. );
  1344.  
  1345. Dwarf_Unsigned dwarf_add_die_to_debug (
  1346.     Dwarf_P_Debug    /*dbg*/,
  1347.     Dwarf_P_Die        /*die*/,
  1348.     Dwarf_Error*    /*error*/
  1349. );
  1350.  
  1351. Dwarf_P_Die dwarf_die_link (
  1352.     Dwarf_P_Die        /*die*/,
  1353.     Dwarf_P_Die     /*parent*/,
  1354.     Dwarf_P_Die     /*child*/, 
  1355.     Dwarf_P_Die        /*left*/,
  1356.     Dwarf_P_Die        /*right*/, 
  1357.     Dwarf_Error*     /*error*/
  1358. );
  1359.  
  1360. /* Operations to create location expressions. */
  1361. Dwarf_P_Expr dwarf_new_expr (
  1362.     Dwarf_P_Debug     /*dbg*/, 
  1363.     Dwarf_Error*     /*error*/
  1364. );
  1365.  
  1366. Dwarf_Unsigned dwarf_add_expr_gen (
  1367.     Dwarf_P_Expr     /*expr*/, 
  1368.     Dwarf_Small     /*opcode*/, 
  1369.     Dwarf_Unsigned     /*val1*/, 
  1370.     Dwarf_Unsigned     /*val2*/, 
  1371.     Dwarf_Error*     /*error*/
  1372. );
  1373.  
  1374. Dwarf_Unsigned dwarf_add_expr_addr (
  1375.     Dwarf_P_Expr     /*expr*/, 
  1376.     Dwarf_Unsigned     /*addr*/, 
  1377.     Dwarf_Signed     /*sym_index*/, 
  1378.     Dwarf_Error*     /*error*/
  1379. );
  1380.  
  1381. Dwarf_Unsigned dwarf_expr_current_offset (
  1382.     Dwarf_P_Expr     /*expr*/, 
  1383.     Dwarf_Error*     /*error*/
  1384. );
  1385.  
  1386. Dwarf_Addr dwarf_expr_into_block (
  1387.     Dwarf_P_Expr     /*expr*/, 
  1388.     Dwarf_Unsigned*     /*length*/, 
  1389.     Dwarf_Error*     /*error*/
  1390. );
  1391.  
  1392. Dwarf_Unsigned dwarf_add_arange (
  1393.     Dwarf_P_Debug     /*dbg*/, 
  1394.     Dwarf_Addr         /*begin_address*/, 
  1395.     Dwarf_Unsigned     /*length*/, 
  1396.     Dwarf_Signed     /*symbol_index*/, 
  1397.     Dwarf_Error*     /*error*/
  1398. );
  1399.  
  1400. Dwarf_Unsigned dwarf_add_pubname (
  1401.     Dwarf_P_Debug     /*dbg*/, 
  1402.     Dwarf_P_Die     /*die*/, 
  1403.     char*         /*pubname_name*/, 
  1404.     Dwarf_Error*     /*error*/
  1405. );
  1406.  
  1407. Dwarf_Unsigned dwarf_add_funcname (
  1408.     Dwarf_P_Debug     /*dbg*/, 
  1409.     Dwarf_P_Die     /*die*/, 
  1410.     char*         /*func_name*/, 
  1411.     Dwarf_Error*     /*error*/
  1412. );
  1413.  
  1414. Dwarf_Unsigned dwarf_add_typename (
  1415.     Dwarf_P_Debug     /*dbg*/, 
  1416.     Dwarf_P_Die     /*die*/, 
  1417.     char*         /*type_name*/, 
  1418.     Dwarf_Error*     /*error*/
  1419. );
  1420.  
  1421. Dwarf_Unsigned dwarf_add_varname (
  1422.     Dwarf_P_Debug     /*dbg*/, 
  1423.     Dwarf_P_Die     /*die*/, 
  1424.     char*         /*var_name*/, 
  1425.     Dwarf_Error*     /*error*/
  1426. );
  1427.  
  1428. Dwarf_Unsigned dwarf_add_weakname (
  1429.     Dwarf_P_Debug     /*dbg*/, 
  1430.     Dwarf_P_Die     /*die*/, 
  1431.     char*         /*weak_name*/, 
  1432.     Dwarf_Error*     /*error*/
  1433. );
  1434.  
  1435. void dwarf_p_dealloc (
  1436.     void*         /*space*/, 
  1437.     Dwarf_Unsigned     /*type*/
  1438. );
  1439.  
  1440. int
  1441. dwarf_attr_offset (
  1442.     Dwarf_Die       /*die*/,
  1443.     Dwarf_Attribute /*attr of above die*/,
  1444.     Dwarf_Off     * /*returns offset thru this ptr */,
  1445.     Dwarf_Error   * /*error*/
  1446. );
  1447.  
  1448.  
  1449. #ifdef __cplusplus
  1450. }
  1451. #endif
  1452. #endif /* _LIBDWARF_H */
  1453.  
  1454.